<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			#out2{
				width: 500px;
				height: 1500px;
				background-color: skyblue;
		
			}
			#out{
				width: 300px;
				height: 300px;
				background-color: antiquewhite;
				position: sticky;
				top: 0;
			}
			#in{
				width: 100px;
				height: 100px;
				background-color: red;
				position: sticky;
				top: 100px;
				left: 100px;
			}
		</style>
	</head>
	<body>
		<div id="out">
			<div id="in"></div>
		</div>
		<div id="out2">
		</div>
	
	</body>
</html>